﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Gui/masterPage.Master" AutoEventWireup="true" CodeBehind="ProductDetail.aspx.cs" Inherits="OnlineStore.Gui.ProductDetail" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentTitle" runat="server">
    
    <h1>Chào Mừng ng bạn đến với Shop OnlineStore</h1>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentCenter" runat="server">
    <h2> Hãy thỏa sức shopping online cùng shop quần áo rẻ đẹp nhé.</h2>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentTop" runat="server">
     <h1><asp:Label ID="lb_Title" runat="server" Text="Chi tiết sản phẩm"></asp:Label></h1>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="MainContent" runat="server">

<script language="javascript" type="text/javascript" src="../../Scripts/jquery-1.4a2.js"></script>
    <script language="javascript" type="text/javascript">
        $(function () {
            $("img").mouseover(function () {
                var classname = this.className.match("star");
                if (classname) {
                    giveRating($(this), "FilledStar.png");
                    $(this).css("cursor", "pointer");
                }
            });

            $("img").mouseout(function () {
                var classname = this.className.match("star");
                if (classname) {
                    giveRating($(this), "EmptyStar.png");
                }
            });

            $("img").click(function () {
                var classname = this.className.match("star");
                if (classname) {
                    $("img").unbind("mouseout mouseover click");

                    // call ajax methods to update database
                    var idproduct;
                    var url = "GetRating.aspx?rating=" + parseInt($(this).attr("id") + "idproduct=" + parseInt(idproduct));
                    $.post(url, null, function (data) {
                        $("#result").text(data);
                    });
                }
            });
        });

        function giveRating(img, image) {
            img.attr("src", "/Content/Images/" + image)
               .prevAll("img").attr("src", "/Content/Images/" + image);
        }
    </script> 

    <%--<form  method="get" runat="server" id="Cart"  submitdisabledcontrols="False">--%>
        <asp:Label ID="Product_find" Visible="false" runat="server" Text="sản phẩm không được tìm thấy"></asp:Label>
<%
    if (this.Product_find.Visible == false)
    {
%>
       <div style="width: 100%; margin-bottom: 30px;">
      <table style="width: 100%; border-collapse: collapse;">
        <tbody><tr>
          <td style="text-align: center; width: 250px; vertical-align: top;">
             <%--<a href="../../img/<%= _product.Picture %>" title="ĐẦM D724" class="thickbox" rel="gallery">
                <img src="../../img/<%= _product.Picture %>" id="image" title="ĐẦM D724" alt="ĐẦM D724" id="image" style="margin-bottom: 3px;" width="250" height="250">
                 
              </a>--%>
              <asp:HyperLink ID="HL_Img_product" runat="server">
                  <asp:Image ID="Image_product" runat="server" ImageUrl="../img/004D001.jpg" style="margin-bottom: 3px;" width="250" />
                 </asp:HyperLink>
              <br>
          </td>
          <td style="padding-left: 15px; width: 296px; vertical-align: top;">
            <table width="100%">
              <tbody>
               <tr>
                <td style="width: 68px"><b style="width:100px">Giá:</b></td>
                <td>                  
                <%--<%: String.Format("{0:0,0 VNĐ}", DataBinder.Eval(container.) %>  --%>
                    <asp:Label ID="lb_price" runat="server" Text=""></asp:Label>              
                </td>
              </tr>
                            <tr>
                <td style="width: 68px"><b>Trạng thái:</b></td>
                <td><%--<%= ViewData["status"].ToString() %>--%>
                    <asp:Label ID="lb_Status" runat="server"></asp:Label>
                </td>
              </tr>
              <tr>
                <td style="width: 68px"><b>Kiểu:</b></td>
                <td>
                    <%--<%:_product.Type %>--%>
                    <asp:Label ID="lb_Type" runat="server" ></asp:Label>
                </td>
              </tr>
              <tr>
                <td style="width: 68px"><b>màu sắc</b></td>
                <td><p>
                    <%--<%: _product.Color %>--%>
                    <asp:Label ID="lb_Color" runat="server" ></asp:Label>
                </p></td>
              </tr>
              <tr>
                <td style="width: 68px"><b>Đánh giá:</b></td>
                <td><div>
                <img class="star" src="../Content/Images/EmptyStar.png" alt="Star Rating" align="middle" id="1" />
                <img class="star" src="../Content/Images/EmptyStar.png" alt="Star Rating" align="middle" id="2" />
                <img class="star" src="../Content/Images/EmptyStar.png" alt="Star Rating" align="middle" id="3" />
                <img class="star" src="../Content/Images/EmptyStar.png" alt="Star Rating" align="middle" id="4" />
                <img class="star" src="../Content/Images/EmptyStar.png" alt="Star Rating" align="middle" id="5" />
                </div><br />
                <div id="result"></div>
                </td>
                </tr>
              <tr>
                <td style="width: 68px"><b>Mô tả</b></td>
                <td><p>
                    <%--<%: _product.Introduce %>--%>
                    <asp:Label ID="lb_Introduce" runat="server" ></asp:Label>
                    </p></td>
              </tr>
			</tbody>
            </table>
                </br>

            
                <div style="width: 100%;" id="nut-may-in">
                    <table>
                    <tbody>
                        <tr>
                            <td>
                            <%string s = Request.Url.AbsoluteUri; %>
                            <iframe src="//www.facebook.com/plugins/like.php?href=<%:s %>%2F&amp;send=false&amp;layout=standard&amp;width=200&amp;show_faces=true&amp;font&amp;colorscheme=light&amp;action=like&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:200px; height:80px;" allowTransparency="true"></iframe>
                            
                            </br>
                            
                             </td>
                            <td>
                                <img src="../../img/icon-print-02.jpg" alt="bản in" width="16" height="16"> <b>Bản In</b></a>
                            </td>
                        </tr>
                    </tbody>
                    </table>
                 </div>
                 <div class="content">
                    Số lượng:                
                     <asp:TextBox ID="Qty" runat="server" size="3" value="1"></asp:TextBox>
                        &nbsp;<asp:Button ID="add_to_cart" runat="server" Text="Chọn mua" 
                         onclick="Lick_Mua"/>
                 </div>
            </td>
        </tr>
      </tbody>
      </table>
      <div>
        <p><b> Chi tiết</b> </p>
        <p>
            <%--<%: _product.Detail %>--%>
            <asp:Label ID="lb_Detail" runat="server"></asp:Label>
        </p>
      </div>
    </div>
<% 
    }
%>
  <%--  </form>--%>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="ContentButtom" runat="server">
    <h1>Các sản phẩm tương tự</h1>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="Contentlist" runat="server">
    <asp:DataList ID="mainlist" runat="server" CellPadding="2" CellSpacing="2" 
        RepeatColumns="4" CssClass="list">
    <ItemTemplate>
                   <a href = "/Gui/ProductDetail.aspx?id=<%#DataBinder.Eval(Container.DataItem, "id")%>">
                    <img src="../../img/<%# DataBinder.Eval(Container.DataItem,"Picture")%>" title="<%# DataBinder.Eval(Container.DataItem, "Product_Name")%>" width="120" height="120" alt="<%# DataBinder.Eval(Container.DataItem, "Product_Name")%>"></a><br>
                  <div><img src="../../img/special.png" /><img src="../../img/special.png" /><img src="../../img/special.png" /><img src="../../img/special.png" /><img src="../../img/special.png" /></div>
                 <a href = "/Gui/ProductDetail.aspx?id=<%#DataBinder.Eval(Container.DataItem, "id")%>"><%# DataBinder.Eval(Container.DataItem, "Product_Name")%></a><br>
                 <span style="color: #999; font-size: 11px;"><%# DataBinder.Eval(Container.DataItem, "Type")%></span><br>
                  <span style="color: #900; font-weight: bold;"><%# String.Format("{0:0,0 VNĐ}", DataBinder.Eval(Container.DataItem, "Price"))%> </span> <br>
    </ItemTemplate>
    </asp:DataList>
</asp:Content>
